import request from "@/utils/request";

// 查询营销公司列表
export function getMarketingList(data) {
  return request({
    url: "/frequency/cmarketingcompany/list",
    method: "post",
    data,
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize,
    },
  });
}

// 查询账户列表
export function listUser(params) {
  return request({
    url: "/system/user/list",
    method: "get",
    params,
  });
}

// 查询角色列表
export function listRole(params) {
  return request({
    url: "/system/role/list",
    method: "get",
    params,
  });
}

// 区域_同步数据
export function synchronizeDataRegion(data) {
  return request({
    url: "/frequency/cmanufactureregion/synchronizeDataRegion",
    method: "post",
    data,
  });
}

// 查询区域列表
export function getRegionList(data) {
  return request({
    url: "/frequency/cmanufactureregion/list",
    method: "post",
    data,
    params: data,
  });
}

// 区域新增
export function addRegion(data) {
  return request({
    url: "/frequency/cmanufactureregion",
    method: "post",
    data,
  });
}

// 区域修改
export function editRegion(data) {
  return request({
    url: "/frequency/cmanufactureregion",
    method: "put",
    data,
  });
}

// 区域删除
export function delRegion(ids) {
  return request({
    url: `/frequency/cmanufactureregion/${ids}/2`,
    method: "DELETE",
  });
}

// 用户绑定区域
export function userBindArea(params) {
  return request({
    url: "/system/user/bindArea",
    method: "post",
    params,
  });
}

//区域详情
export function getRegionDetail(id) {
  return request({
    url: `/frequency/cmanufactureregion/${id}`,
    method: "get", 
  }) 
}